Skip to content

TST: add mixed-int-string Index to conftest fixtures#65177

Merged
mroeschke merged 2 commits into
pandas-dev:mainfrom
jbrockmendel:tst-54072
Apr 16, 2026
Merged

TST: add mixed-int-string Index to conftest fixtures#65177
mroeschke merged 2 commits into
pandas-dev:mainfrom
jbrockmendel:tst-54072

Conversation

@jbrockmendel
Copy link
Copy Markdown
Member

Summary

  • closes TST: mixed_int_string Index #54072
  • Add "mixed-int-string": Index([0, "a", 1, "b", 2, "c"]) to indices_dict in conftest.py
  • Fix the 27 tests it broke by: using safe_sort_index for order-independent comparisons, expecting TypeError for genuinely unsortable operations (argsort, sort_values, searchsorted, numpy min/max), and handling RuntimeWarning for unorderable MultiIndex union

Test plan

  • All 27 previously-failing mixed-int-string tests now pass
  • Full regression run on all 9 modified test files: 6330 passed, 0 failed
  • pre-commit hooks pass
  • mypy clean (no new errors)

🤖 Generated with Claude Code

@jbrockmendel jbrockmendel added the Testing pandas testing functions or related to the test suite label Apr 11, 2026
jbrockmendel and others added 2 commits April 15, 2026 10:09
Add a "mixed-int-string" entry (Index([0, "a", 1, "b", 2, "c"])) to
indices_dict and fix the 27 tests it broke. All failures stemmed from
Python 3 not supporting < / > between int and str.

- Use safe_sort_index instead of sort_values for order-independent
  comparisons in set-op tests
- Expect TypeError for argsort, sort_values, searchsorted, and
  numpy min/max reductions on mixed-type indices
- Handle RuntimeWarning for unorderable MultiIndex union

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ndas-dev#54072)

Add index_sortable, index_flat_sortable, index_with_missing_sortable,
and index_or_series_obj_orderable fixtures that exclude the
mixed-int-string Index via params filtering. Use these in tests that
require sorting/ordering so test bodies stay clean with no try/except
that could swallow bugs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbrockmendel jbrockmendel marked this pull request as ready for review April 15, 2026 21:58
@mroeschke mroeschke added this to the 3.1 milestone Apr 16, 2026
@mroeschke mroeschke merged commit 54619a1 into pandas-dev:main Apr 16, 2026
45 checks passed
@mroeschke
Copy link
Copy Markdown
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the tst-54072 branch April 16, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing pandas testing functions or related to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TST: mixed_int_string Index

2 participants